﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>ready.html</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="../js/jquery-1.8.2.js"></script>
  </head>
  <body>
	
	<select id="city">
		<option value="bj">北京</option>	
		<option value="sh">上海</option>	
		<option value="gz">广州</option>
	</select>
	
	<script type="text/javascript">
		//当<select>标签触发onchange事件,显示选中<option>的value和innerHTML属性的值
		$("#city").change( function(){ 
			var $option = $("#city option:selected");
			var value = $option.val();
			var text = $option.text();
			alert(value+":"+text);
		} );
	</script>
		
  </body>
</html>




